<template>
    <div class="ma-content-block lg:flex justify-between p-4">
      <!-- CRUD 组件 -->
      <ma-crud :options="options" :columns="columns" ref="crudRef">
        <template #tableBeforeButtons>
            <a-button type="primary" @click="handleAdd(1,{})">新增</a-button>
        </template>
        
        
        <template #status="{record}">
          <a-tag color="green" v-if="record.status == 1">正常</a-tag>
          <a-tag color="gray" v-if="record.status == 2">停用</a-tag>
        </template>
        <template #tag="{record}">
            <div class="flex justify_center" >
                <div class="" v-for="(item,index) in record.tag" style="margin-right: 10px">
                <a-tag :color="item.tag_color"> {{ item.tag_name }}</a-tag>
                </div>
            </div>
        </template>
        <template #type="{record}">
          <a-tag color="blue" >{{record.type == 3?'配送':record.type == 4?'装卸':'铁路局'}}</a-tag>
        </template>
        <template #name="{ record }">
          <a-tooltip :content="record?.name">
            <div class="ellipsis">{{record?.name}}</div>
          </a-tooltip>
          
        </template>
        <template #operationBeforeExtend="{ record }">
          <!-- <a-link @click="openShow(record,'')">账单明细</a-link> -->
          <a-link @click="handleZhuangxie(record)" v-if="record.type == 4">清算标准</a-link>
          <a-link @click="handleTieluju(record)" v-if="record.type == 5">清算标准</a-link>
          <a-link @click="handlePrice(record)" v-if="record.type == 3">清算标准</a-link>
          <a-link @click="handleDrtail(record)">详情</a-link>
          <a-link @click="handleAdd(2,record)">编辑</a-link>
        </template>
      </ma-crud>
      <a-drawer
        :footer="false"
        :width="1400"
        v-model:visible="visible"
        >
        <template #title> 账单详情 </template>
        <PayOrderList ref="payOrderRef"  />
      </a-drawer>

      <!-- 详情弹窗 -->
      <a-modal :mask-closable="false"  v-model:visible="visible_detail" :width="1080" @cancel="handleDetailCancel" :footer="false">
        <template #title>
          客户详情
        </template>
        <div>
          <div class="flex justify_between align_center marbot12">
            <div class="flex align_center">
              <div class="font18 bold marr12 hei">{{setailItem.name}}</div>
              <div class="font14" :class="setailItem.status == 1?'green':'hui'">· {{setailItem.status == 1?'正常':'停用'}}</div>
            </div>
            <div class="flex align_center" >
              <div class="font14 hei" >创建时间：{{setailItem.created_at}}</div>
             
            </div>
          </div>
          <div class="huiBox flex justify_around marbot12">
            <div class="flex_1 flex flex_column justify_center">
              <div class="font14 text_center marbot4">应收款金额</div>
              <div class="bule  bold text_center flex align_end justify_center">
                <div class="font20 bold marr2 ">1512.12 </div>
                <div class="font14 "> 元</div>
              </div>
            </div>
            <div class="flex_1 flex flex_column justify_center">
              <div class="font14 text_center marbot4">应付款金额</div>
              <div class="bule  bold text_center flex align_end justify_center">
                <div class="font20 bold marr2 ">642.21 </div>
                <div class="font14 "> 元</div>
              </div>
            </div>
            
          </div>
          <div class="tabBox flex marbot12">
            <div class="tab cursor" :class="detailCentent == 0?'activeTab':''" @click="handleTab(0)">基础信息</div>
          </div>
          <div class="contenBox" style="overflow: auto;">
              <!-- 基础信息 -->
              <div class=""  v-if="detailCentent == 0">
                <div style="margin-bottom: 16px">
                  <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
                    <template #title>
                      <div style="color:rgba(0, 82, 217, 1);font-weight:600">基本信息</div>
                    </template>
                    <div class="flex marbot24 align_center" style="width:100%">
                      <div class="flex" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                        <div class="font14 marbot4">客户名称：</div>
                        <div>{{setailItem.name}}</div>
                      </div>
                      <div  class="flex" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                        <div  class="font14 marbot4">客户类型：</div>
                        <div>{{ setailItem.customer_type == 1?'企业':'个人' }}</div>
                      </div>
                      <div style="width:calc((100% - 72px) / 3);">
                        <div class="font14 marbot4">负责人:</div>
                        <a-input v-model="setailItem.leader" placeholder="请输入负责人" allow-clear  />
                      </div>
                    </div>
                    <div class="flex marbot24" style="width:100%">
                      <div style="margin-right:36px;width:calc((100% - 72px) / 3);">
                        <div class="font14 marbot4">联系电话:</div>
                        <a-input v-model="setailItem.phone" placeholder="请输入负责人" allow-clear  />
                      </div>
                      <!-- <div style="margin-right:36px;width:calc((100% - 72px) / 3);">
                        <div class="font14 marbot4">邮箱:</div>
                        <a-input v-model="setailItem.e_mail" placeholder="请输入邮箱" allow-clear  />
                      </div> -->
                      <div style="margin-right:36px;width:calc((100% - 72px) / 3);" v-if="setailItem.type == 3">
                        <div class="font14 marbot4">税率:</div>
                        <a-input v-model="setailItem.tax" placeholder="请输入税率" allow-clear >
                          <template #suffix>
                            %
                          </template>
                        </a-input>
                      </div>
                      <div style="width:calc((100% - 72px) / 3);">
                        <div class="font14 marbot4">纳税人识别号:</div>
                        <a-input v-model="setailItem.card_id" placeholder="请输入纳税人识别号" allow-clear  />
                      </div>
                    </div>
                    <div class="flex marbot24" style="width:100%">
                      <!-- <div style="margin-right:36px;width:calc((100% - 72px) / 3);" v-if="setailItem.type == 3">
                        <div class="font14 marbot4">税率:</div>
                        <a-input v-model="setailItem.tax" placeholder="请输入税率" allow-clear >
                          <template #suffix>
                            %
                          </template>
                        </a-input>
                      </div> -->
                      <div style="margin-right:36px;width:calc((100% - 72px) / 3);">
                        <div class="font14 marbot4">状态</div>
                        <div class="flex align_center" style="height:32px">
                          <a-space size="large">
                            <a-radio-group v-model="setailItem.status" :options="statusList" />
                          </a-space>
                        </div>
                      </div>
                    </div>
                    <!-- <div class="flex marbot24" style="width:100%">
                      <div style="width:100%;">
                        <div class="font14 marbot4">营业执照：</div>
                        <ma-upload v-model="setailItem.file" type='image' />
                      </div>
                    </div>
                    <div class="flex marbot24" style="width:100%">
                      <div style="width:100%;">
                        <div class="font14 marbot4">备注:</div>
                        <a-textarea placeholder="请输入备注" v-model="setailItem.remark" allow-clear/>
                      </div>
                    </div> -->
                  </a-card>
                </div>
                <!-- <div style="margin-bottom: 16px">
                  <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
                    <template #title>
                      <div style="color:rgba(0, 82, 217, 1);font-weight:600">开票信息</div>
                    </template>
                    <div class="flex marbot24" style="width:100%">
                      <div class="flex align_center" style="margin-right:36px;flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">公司名称：</div>
                        <a-input v-model="setailItem.company_name" placeholder="请输入公司名称" allow-clear  />
                      </div>
                      <div class="flex align_center" style="flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">公司税号：</div>
                        <a-input v-model="setailItem.tax_id" placeholder="请输入公司税号" allow-clear  />
                      </div>
                    </div>
                    <div class="flex marbot24" style="width:100%">
                      <div class="flex align_center" style="margin-right:36px;flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">注册地址：</div>
                        <a-input v-model="setailItem.company_address" placeholder="请输入注册地址" allow-clear  />
                      </div>
                      <div class="flex align_center" style="flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">注册电话：</div>
                        <a-input v-model="setailItem.company_phone" placeholder="请输入注册电话" allow-clear  />
                      </div>
                    </div>
                  </a-card>
                </div> -->
                <!-- <div style="margin-bottom: 16px">
                  <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
                    <template #title>
                      <div style="color:rgba(0, 82, 217, 1);font-weight:600">银行账户信息</div>
                    </template>
                    <div class="flex marbot24" style="width:100%">
                      <div class="flex align_center" style="margin-right:36px;flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">开户银行：</div>
                        <a-input v-model="setailItem.opening_bank" placeholder="请输入开户银行" allow-clear  />
                      </div>
                      <div class="flex align_center" style="flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">银行账号：</div>
                        <a-input v-model="setailItem.account" placeholder="请输入银行账号" allow-clear  />
                      </div>
                    </div>
                    <div class="flex marbot24" style="width:100%">
                      <div class="flex align_center" style="margin-right:36px;flex:1;">
                        <div class="font14 marbot4" style="width: 100px;">账户名称：</div>
                        <a-input v-model="setailItem.account_name" placeholder="请输入账户名称" allow-clear  />
                      </div>
                      <div style="flex:1;">
                        
                      </div>
                    </div>
                  </a-card>
                </div> -->
                <a-button type="primary" @click="update">保存</a-button>
              </div>
          </div>
        </div>
      </a-modal>


      <!-- 新增/编辑 -->
      <a-modal :mask-closable="false"  v-model:visible="visible_Add" :width="1080" @cancel="visible_Add=false" :on-before-ok="handleAddOk">
        <template #title>
          {{addType == 1?'新增':'编辑'}}
        </template>
        <div class="contenBox" style="overflow: auto;">
          <div style="margin-bottom: 16px">
            <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
              <template #title>
                <div style="color:rgba(0, 82, 217, 1);font-weight:600">基本信息</div>
              </template>
              <div class="flex marbot24 align_center" style="width:100%" >
                <div class="flex align_center" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                  <div class="font14 ">类型：</div>
                  <div class="flex align_center" style="height:32px">
                    <a-space size="large">
                      <a-radio-group v-model="addItem.type" :options="typeList" @change="handleType" />
                    </a-space>
                  </div>
                </div>
                <div class="flex align_center" style="margin-right:36px;width:calc((100% - 72px) / 3);">
                  <div class="font14 ">状态：</div>
                  <div class="flex align_center" style="height:32px">
                    <a-space size="large">
                      <a-radio-group v-model="addItem.status" :options="statusList" />
                    </a-space>
                  </div>
                </div>
                <div  style="width:calc((100% - 72px) / 3);">
                  <div class="font14 marbot4">客户名称：</div>
                  <a-input v-model="addItem.name" placeholder="请输入客户名称" allow-clear  />
                </div>
              </div>
              <div class="flex marbot24 align_center" style="width:100%" >
                <div style="width:calc((100% - 72px) / 3);margin-right:36px;">
                  <div class="font14 marbot4">负责人:</div>
                  <a-input v-model="addItem.leader" placeholder="请输入负责人" allow-clear  />
                </div>
                <div style="margin-right:36px;width:calc((100% - 72px) / 3);">
                  <div class="font14 marbot4">联系电话:</div>
                  <a-input v-model="addItem.phone" placeholder="请输入负责人" allow-clear  />
                </div>
                <!-- <div style="width:calc((100% - 72px) / 3);">
                  <div class="font14 marbot4">邮箱:</div>
                  <a-input v-model="addItem.e_mail" placeholder="请输入邮箱" allow-clear  />
                </div> -->
                <div style="width:calc((100% - 72px) / 3);">
                  <div class="font14 marbot4">纳税人识别号:</div>
                  <a-input v-model="addItem.card_id" placeholder="请输入纳税人识别号" allow-clear  />
                </div>
              </div>
              <div class="flex marbot24" style="width:100%" >
                <!-- <div style="width:calc((100% - 72px) / 3);margin-right:36px;">
                  <div class="font14 marbot4">纳税人识别号:</div>
                  <a-input v-model="addItem.card_id" placeholder="请输入纳税人识别号" allow-clear  />
                </div> -->
                <div style="width:calc((100% - 72px) / 3);" v-if="addItem.type == 3">
                  <div class="font14 marbot4">税率:</div>
                  <a-input v-model="addItem.tax" placeholder="请输入税率" allow-clear >
                    <template #suffix>
                      %
                    </template>
                  </a-input>
                </div>
              </div>
              <!-- <div class="flex marbot24" style="width:100%">
                <div style="width:100%;">
                  <div class="font14 marbot4">营业执照：</div>
                  <ma-upload v-model="addItem.file" type='image' />
                </div>
              </div>
              <div class="flex marbot24" style="width:100%" >
                <div style="width:100%;">
                  <div class="font14 marbot4">备注:</div>
                  <a-textarea placeholder="请输入备注" v-model="addItem.remark" allow-clear/>
                </div>
              </div> -->
            </a-card>
          </div>
          <!-- <div style="margin-bottom: 16px">
            <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
              <template #title>
                <div style="color:rgba(0, 82, 217, 1);font-weight:600">开票信息</div>
              </template>
              <div class="flex marbot24" style="width:100%" >
                <div class="flex align_center" style="margin-right:36px;flex:1;">
                  <div class="font14 marbot4" style="width: 100px;">公司名称：</div>
                  <a-input v-model="addItem.company_name" placeholder="请输入公司名称" allow-clear  />
                </div>
                <div class="flex align_center" style="flex:1;" >
                  <div class="font14 marbot4" style="width: 100px;">公司税号：</div>
                  <a-input v-model="addItem.tax_id" placeholder="请输入公司税号" allow-clear  />
                </div>
              </div>
              <div class="flex marbot24" style="width:100%" >
                <div class="flex align_center" style="margin-right:36px;flex:1;">
                  <div class="font14 marbot4" style="width: 100px;">注册地址：</div>
                  <a-input v-model="addItem.company_address" placeholder="请输入注册地址" allow-clear  />
                </div>
                <div class="flex align_center" style="flex:1;">
                  <div class="font14 marbot4" style="width: 100px;">注册电话：</div>
                  <a-input v-model="addItem.company_phone" placeholder="请输入注册电话" allow-clear  />
                </div>
              </div>
            </a-card>
          </div>
          <div >
            <a-card  :header-style="{background:'#f5f5f5',color:'rgba(0, 82, 217, 1)',fontWeight:'600'}">
              <template #title>
                <div style="color:rgba(0, 82, 217, 1);font-weight:600">银行账户信息</div>
              </template>
              <div class="flex marbot24" style="width:100%">
                <div class="flex align_center" style="margin-right:36px;flex:1;">
                  <div class="font14 marbot4" style="width: 100px;">开户银行：</div>
                  <a-input v-model="addItem.opening_bank" placeholder="请输入开户银行" allow-clear  />
                </div>
                <div class="flex align_center" style="flex:1;">
                  <div class="font14 marbot4" style="width: 100px;">银行账号：</div>
                  <a-input v-model="addItem.account" placeholder="请输入银行账号" allow-clear  />
                </div>
              </div>
              <div class="flex marbot24" style="width:100%">
                <div class="flex align_center" style="margin-right:36px;flex:1;">
                  <div class="font14 marbot4" style="width: 100px;">账户名称：</div>
                  <a-input v-model="addItem.account_name" placeholder="请输入账户名称" allow-clear  />
                </div>
                <div style="flex:1;">
                  
                </div>
              </div>
            </a-card>
          </div> -->
        </div>
      </a-modal>

      <!-- 充值 -->
      <AddMoneyModal
        ref="addMoneyRef"
      />
      <a-drawer
        :footer="false"
        :width="1400"
        v-model:visible="priceVisible"
        >
        <template #title> 清算标准 </template>
        <deptAddress ref="payOrderRef" v-if="priceVisible" :fromData="fromData" />
      </a-drawer>
      <a-drawer
        :footer="false"
        :width="1400"
        v-model:visible="zhuangxieVisible" 
        >
        <template #title> 清算标准比例设置 </template>
        <zhuangxiePeizhi  v-if="zhuangxieVisible" :fromData="fromData" @shuaxin='hgandleShuaxin' />
      </a-drawer>
      <a-drawer
        :footer="false"
        :width="1400"
        v-model:visible="tieluVisible"
        >
        <template #title> 清算标准比例设置 </template>
        <tielujuPeizhi  v-if="tieluVisible" :fromData="fromData" @shuaxin='hgandleShuaxin' />
      </a-drawer>
    </div>
  </template>
  <script setup>
  import {ref, reactive, nextTick, onMounted} from 'vue'
  import user from "@/api/system/user";
  import dept from "@/api/system/dept";
  import { Message,Modal } from '@arco-design/web-vue'
  import tool from '@/utils/tool'
  import { request } from "@/utils/request.js";
  import * as common from '@/utils/common'
  import {cloneDeep} from "lodash";
  import MaFormModal from "@/components/ma-form-modal/index.vue";
  import AddMoneyModal from "@/views/financial/moneyLog/AddMoney.vue"
  import deptAddress from "@/views/system/deptAddress/index.vue"
  import zhuangxiePeizhi from "@/views/financial/financeLedger/zhuangxiePeizhi.vue"
  import tielujuPeizhi from "@/views/financial/financeLedger/tieluju.vue"
  import { color } from 'echarts';
  const addMoneyRef = ref()
//   import PayOrderList from "@/views/financial/payOrder/index.vue"
  const crudRef = ref()
  const visible_Add = ref(false)
  const priceVisible = ref(false)
  const zhuangxieVisible = ref(false)
  const tieluVisible = ref(false)
  const fromData = ref({})
  const addType = ref()
  const visible = ref()
  const payOrderRef = ref()
  const is_one = ref(true)
  const haseinfo = ref({
    money:{
      settle_day:0,
      bill_day:0,
    }
  })
  const checkColumns = [
    {
      title: "备注",
      dataIndex: "remark",
      formType: "textarea"
    }
  ]
  const hgandleShuaxin = ()=>{
    zhuangxieVisible.value = false
    tieluVisible.value = false
  }
  const handleTieluju = (row) =>{
    fromData.value = row
    setTimeout(() => {
      tieluVisible.value = true
    }, 200);
  }
  const handleZhuangxie = (row) =>{
    fromData.value = row
    setTimeout(() => {
      zhuangxieVisible.value = true
    }, 200);
  }
  const handlePrice = (row) =>{
    fromData.value = row
    setTimeout(() => {
      priceVisible.value = true
    }, 200);
  }
  const addItem = ref({
    type:3,
    tax:'',    //税率
    customer_type:1,
    status:1,
    name:'',
    leader:'',
    phone:'',
    e_mail:'',
    card_id:'',
    file:'',
    tag_ids:[],
    remark:'',
    company_name:'',  // 公司名称
    tax_id:'',  // 税号
    company_address:'',  // 注册地址
    company_phone:'',  // 注册电话
    opening_bank:'', // 开户行
    account:'', // 收款账户
    account_name:'', // 开户名称
  })
  const typeList = ref([
    {label:'配送',value:3},
    {label:'装卸',value:4},
    {label:'铁路局',value:5},
  ])
  const customerTypeList = ref([
    {label:'企业',value:1},
  ])
  const statusList= ref([
    {label:'正常',value:1},
    {label:'停用',value:2},
  ])
  const tagList = ref([
    
  ])
  const sumbitType = ref("");
  const addFormRef = ref("");
  const visible_detail = ref(false)
  const setailItem = ref({})
  const detailCentent = ref(0)
  const handleDrtail = (row)=>{
    console.log('查看详情',row)
    let  newRow = JSON.parse(JSON.stringify(row))
    let tag = []
    if(newRow.tag.length != 0){
        newRow.tag.map((v,i)=>{
            tag.push(v.tag_id)
        })
    }
    newRow.tag_ids = tag
    setailItem.value = newRow
    detailCentent.value = 0
    visible_detail.value = true
  }
  onMounted(()=>{
    request({
      url:'system/tag/index',
      method: 'get',
      params:{
        openPage:false
      },
    }).then(res=>{
      tagList.value = res.data.items
    })
  })
  const handleAdd = (type,item)=>{
    visible_Add.value = true
    addType.value = type
    if(type == 1){
        addItem.value = {
            type:3,
            customer_type:1,
            status:1,
            name:'',
            leader:'',
            phone:'',
            e_mail:'',
            card_id:'',
            file:'',
            tax:'',
            tag_ids:[],
            remark:'',
            company_name:'',  // 公司名称
            tax_id:'',  // 税号
            company_address:'',  // 注册地址
            company_phone:'',  // 注册电话
            opening_bank:'', // 开户行
            account:'', // 收款账户
            account_name:'', // 开户名称
        }
    }else{
        let tag = []
        if(item.tag.length != 0){
            item.tag.map((v,i)=>{
                tag.push(v.tag_id)
            })
        }
        addItem.value = {
            id:item.id,
            type:item.type - 0,
            customer_type:1,
            status:item.status,
            name:item.name,
            leader:item.leader,
            phone:item.phone,
            e_mail:item.e_mail,
            card_id:item.card_id,
            file:item.file,
            tag_ids:tag,
            tax:item.tax,
            remark:item.remark,
            company_name:'',  // 公司名称
            tax_id:'',  // 税号
            company_address:'',  // 注册地址
            company_phone:'',  // 注册电话
            opening_bank:'', // 开户行
            account:'', // 收款账户
            account_name:'', // 开户名称
        }
    }
    
  }
  const handleAddOk = async ()=>{
    if(addType.value == 1){
        let res = await dept.save(addItem.value)
        if(res.code == 200){
          Message.success('添加成功')
          crudRef.value.refresh()
          return true
        }else{
          Message.error(res.message)
          return false
        }
    }else{
        let res = await dept.update(addItem.value.id,addItem.value)
        if(res.code == 200){
          Message.success('修改成功')
          crudRef.value.refresh()
          return true
        }else{
          Message.error(res.message)
          return false
        }
    }
  }
  const handleType = (e)=>{
    console.log(e)
    if(e == 1){
      customerTypeList.value = [
        {label:'企业',value:1},
      ]
      addItem.customer_type.value = 1
    }else{
      customerTypeList.value = [
        {label:'企业',value:1},
        {label:'个人',value:2},
      ]
      addItem.customer_type.value = 1
    }
  }
  
  const load = () =>{  // 充值结束
    // yueCrudRef.value.refresh()
  }
  const handleDetailCancel = ()=>{
    visible_detail.value = false
  }
  const deptMoneyUpdate = async ()=>{   // 修改周期结算
    let res = await FinancialTopDeptMoney.update(haseinfo.value.money.id,{
      settle_day: haseinfo.value.money.settle_day,
      bill_day: haseinfo.value.money.bill_day
    })
    if (res.success) {
      Message.success(res.message)
    }
  }
  const handleTab = async (index) =>{
    if(index != detailCentent.value){
      detailCentent.value = index
      if(index == 1){
        let res = await dept.read({
          id: setailItem.value.id,
        })
        haseinfo.value = res.data
      }
    }
  }
  const options = reactive({
    id: 'flyos_financial_supplier',
    rowSelection: {
      showCheckedAll: true
    },
    pk: 'id',
    operationColumn: true,
    operationWidth: 160,
    tablePagination:false,
    pageSize:500,
    formOption: {
      viewType: 'modal',
      width: 600
    },
    api: dept.getList,
    // export: {
    //   show: true,
    //   url: 'financial/payOrder/export',
    //   auth: ['financial:payOrder:export']
    // },
    delete: {
      show: true,
      api: dept.deletes,
      auth: ['financial:financeLedger:delete']
    },
    beforeRequest:(params)=>{
        params.type = '3,4,5'
    },
    afterRequest: (params) => {
      
    },
    
  })
  
  const columns = reactive([
    {
      title: "",
      dataIndex: "id",
      formType: "input",
      addDisplay: false,
      editDisplay: false,
      hide: true,

      commonRules: {
        required: true,
        message: "请输入"
      }
    },
    {
      title: "公司名称",
      dataIndex: "name",
      formType: "input",
      align: "center",
      search: true,
    },
    {
      title: "负责人",
      dataIndex: "leader",
      align: "center",
      formType: "input",
      width:120,
    },
    {
      title: "客户类型",
      dataIndex: "type",
      formType: "input",
      align: "center",
    },
    // {
    //   title: "标签",
    //   dataIndex: "tag",
    //   formType: "input",
    //   align: "center",
    // },
    {
      title: "手机号",
      dataIndex: "phone",
      align: "center",
      formType: "input",
    },
    {
      title: "应付款金额",
      dataIndex: "money",
      sortable: { sortDirections: ['ascend', 'descend'],  },
      align: "center",
      formType: "input",
    },
    
    {
      title: "应收款金额",
      dataIndex: "pay_money",
      align: "center",
      sortable: {
          sortDirections: ['ascend', 'descend']
        },
      formType: "input",
    },
    {
      title: "状态",
      dataIndex: "status",
      align: "center",
      formType: "input",
    },
    {
      title: "创建时间",
      dataIndex: "created_at",
      formType: "range",
      align: "center",
      search: false,
      addDisplay: false,
      editDisplay: false,
      hide:true,
      sortable: {
        sortDirections: ["ascend", "descend"],
        sorter: true,
      },
      showTime: true,
    },
  ])

	
  </script>
  <style lang="less" scoped>
    .font20{
      font-size:20px;
      line-height:28px;
    }
    .font18{
      font-size:18px;
      line-height:26px;
    }
    .font14{
      font-size:14px;
      line-height:22px;
    }
    .font12{
      font-size:12px;
      line-height:20px;
    }
    .bold{
      font-weight:600;
    }
    .hei{
      color:rgba(0,0,0,.9);
    }
    .bule{
      color:rgba(0, 82, 217, 1);
    }
    .green{
      color:rgba(43, 164, 113, 1)
    }
    .hui{
      color:rgba(0,0,0,.4)
    }
    .marr12{
      margin-right:12px;
    }
    .marr2{
      margin-right:2px;
    }
    .marbot16{
      margin-bottom:16px;
    }
    .marbot12{
      margin-bottom:12px;
    }
    .marbot4{
      margin-bottom:4px;
    }
    .marbot24{
      margin-bottom:24px;
    }
    .huiBox{
      padding:12px;
      border-radius:4px;
      background:rgba(246, 246, 246, 1);
    }
    .tabBox{
      border-bottom:1px solid rgba(0,0,0,.15);
      .tab{
        padding:5px 14px 14px;
      }
      .activeTab{
        color:rgba(0, 82, 217, 1);
        border-bottom:3px solid rgba(0, 82, 217, 1);
      }
    }
    .contenBox{
      height:500px;
      padding:12px;
    }
    .contenBox::-webkit-scrollbar{
      display: none;
    }
  </style>

  <script> export default { name: 'financial:supplier' } </script>
  